//
//  ViewController.m
//  仿酷我音乐
//
//  Created by mac on 15/11/17.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "ViewController.h"
#import "PlayMusicViewController.h"
#import "RotateTransitionDelegate.h"
@interface ViewController ()
@property (nonatomic, strong) UIView *demoView;

@property (nonatomic, strong) RotateTransitionDelegate *rotateDelegate;
@end

@implementation ViewController

///lazy
-(RotateTransitionDelegate *)rotateDelegate{
    if (_rotateDelegate == nil) {
        _rotateDelegate = [[RotateTransitionDelegate alloc] init];
    }
    return _rotateDelegate;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor orangeColor];
}

//从一个视图控制器跳转到另外一个视图控制器会调用
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    //判断是不是我们需要的视图控制器
    if (![segue.destinationViewController isKindOfClass:[PlayMusicViewController class]]) {
        return;
    }
    
    //设置 modal 专场类型
    PlayMusicViewController *vc = segue.destinationViewController;
    
    //设置为我们自定义的转场
    vc.modalPresentationStyle = UIModalPresentationCustom;
    
    //设置转场动画为我们想要的，而不是系统自带的从下方穿到上方的效果，我们使用代理
    
    vc.transitioningDelegate = self.rotateDelegate;
    
    
    
}

@end
